﻿@using BotDetect.Web.UI.Mvc
@{
    ViewBag.Title = "HomeOnline";
    Layout = "~/Views/Shared/_LayoutHomeOnline.cshtml";
}
@functions{
    public string GetAntiForgeryToken()
    {
        string cookieToken, formToken;
        AntiForgery.GetTokens(null, out cookieToken, out formToken);
        return cookieToken + "," + formToken;
    }
}

@Html.AntiForgeryToken()
<div style="border-bottom: solid #DCDCDC 1px;">
    <div style="border-bottom: 5px solid #003479; display: block; width: 87px; white-space: nowrap; margin-bottom: -1px; color: #003479; text-transform:uppercase; font-weight:bold; font-size:13pt;">Thông tin về hộ gia đình</div>
</div>

<div class="form-horizontal formResident">
    <div id="tplResident" class="hidden">
        <div class="row margin-top-10 resident">
            <div class="col-md-12">
                <label class="control-label col-sm-4 col-xs-6 visible-sm visible-xs">Q.hệ với chủ hộ</label>
                <div class="col-md-2 col-sm-8 col-xs-6">
                    <input type="hidden" name="RESIDENT_ID" id="RESIDENT_ID" />
                    @Html.DropDownList("RELATION_ID", ViewData["relation"] as IEnumerable<SelectListItem>, new { @class = "form-control input-sm", @prevalue = "" })
                </div>

                <label class="control-label col-sm-4 col-xs-6 visible-sm visible-xs">Họ<span style="color:red;">*</span></label>
                <div class="col-md-2 col-sm-8 col-xs-6">
                    <input class="form-control input-sm"  id="LAST_NAME" maxlength="50" name="LAST_NAME" placeholder="Họ" />
                </div>

                <label class="control-label col-sm-4 col-xs-6 visible-sm visible-xs">Tên đệm</label>
                <div class="col-md-2 col-sm-8 col-xs-6">
                    <input class="form-control input-sm" id="MIDDLE_NAME" name="MIDDLE_NAME" maxlength="150" placeholder="Tên đệm" />
                </div>

                <label class="control-label col-sm-4 col-xs-6 visible-sm visible-xs">Tên khai sinh<span style="color:red;">*</span></label>
                <div class="col-md-2 col-sm-8 col-xs-6">
                    <input class="form-control input-sm"  id="FIRST_NAME" name="FIRST_NAME" maxlength="50" placeholder="Tên khai sinh" />
                </div>

                <label class="control-label col-sm-4 col-xs-6 visible-sm visible-xs">Giới tính<span style="color:red;">*</span></label>
                <div class="col-md-1 col-sm-8 col-xs-6">
                    @Html.DropDownList("GENDER_ID", ViewData["gender"] as IEnumerable<SelectListItem>, new { @class = "form-control input-sm validation-require", requiremessage = "Giới tính" })
                </div>

                <label class="control-label col-sm-4 col-xs-6 visible-sm visible-xs">Dân tộc<span style="color:red;">*</span></label>
                <div class="col-md-2 col-sm-8 col-xs-6">
                    @Html.DropDownList("ETHNIC_ID", ViewData["ethnic"] as IEnumerable<SelectListItem>, new { @class = "form-control input-sm validation-require", requiremessage = "Tên" })
                </div>

                <div class="col-md-1 col-sm-8 col-xs-6">
                    <a onclick="return initDeleteRow(this);" style="color:red; padding:7px; text-decoration:none;" href="#"> &nbsp;&nbsp;<i class="fa fa-times"></i> Xóa</a>
                </div>
            </div>
        </div>
    </div>
    <form id="frmResident">
        <div class="form-body">
            <div class="row margin-top-10 headrow">
                <div class="col-md-12">
                    <label class="control-label col-md-2 hidden-sm hidden-xs">Quan hệ với chủ hộ</label>
                    <label class="control-label col-md-2 hidden-sm hidden-xs">Họ<span style="color:red;">*</span></label>
                    <label class="control-label col-md-2 hidden-sm hidden-xs">Tên đệm</label>
                    <label class="control-label col-md-2 hidden-sm hidden-xs">Tên khai sinh<span style="color:red;">*</span></label>
                    <label class="control-label col-md-1 hidden-sm hidden-xs">Giới tính<span style="color:red;">*</span></label>
                    <label class="control-label col-md-2 hidden-sm hidden-xs">Dân tộc<span style="color:red;">*</span></label>
                </div>
            </div>
            <div id="residents">

            </div>

            <div class="row margin-top-10">
                <div class="visible-sm visible-xs"><hr /></div>
                <div class="col-md-11">
                    <div class="pull-right">
                        <button type="button" id="btnAddRowResident" class="btn btn-sm"><i class="fa fa-plus-circle"></i> Thêm thành viên</button>
                    </div>
                </div>
            </div>
            <div style="text-align:center; margin-top:30px;">
                <button class="btn btn-sm" id="btnBack" type="button" style="background-color: #2664B7; color:#ffffff; min-width:100px;"><i class="fa fa-angle-double-left"></i> Quay lại</button>
                <button class="btn btn-sm" type="button" id="btnNext" style="background-color: #2664B7; color:#ffffff; min-width:100px;">Tiếp tục <i class="fa fa-angle-double-right"></i></button>
            </div>
            <div class="hidden-sm hidden-xs" style="height:50px;"></div>
        </div>
    </form>
</div>
<script src="@Url.Content("~/Scripts/Khoitaonam.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        var initData = {
            VerificationToken: "@GetAntiForgeryToken()",
            GetResidentIdUrl: "@Url.Action("GetResidentById", "Online")",
            BackURL: "@Url.Action("Home", "Online")",
            NextURL: "@Url.Action("ResidentDetail", "Online")",
            ResidentPostUrl: "@Url.Action("ResidentPost", "Online")",
            LogoutUrl: "@Url.Action("LogOff", "Online")",
            LoginUrl: "@Url.Action("Login", "Online")",
            GetHouseHoldUrl: "@Url.Action("GetHouseholdDetail", "Online")"
        };
        Khoitaonam.init(initData);
    });
</script>